// pages/login-forget-password/login-forget-password.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mobileNo: "13362748262",
    code: "获取验证码",
    curTime: 60,
    idDisabled: false,
    isError3: true,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  //获取验证码
  getVerfyCode: function (res) {
    if (this.data.idDisabled) {
      return
    }
    this.startDownTime();
  },
  //开始倒计时
  startDownTime: function () {
    let that = this;
    var timer = setInterval(function () {
      that.data.curTime--;
      that.setData({
        code: '获取验证码(' + that.data.curTime + '秒)',
        idDisabled: true
      })
      if (that.data.curTime <= 0) {
        clearInterval(timer)
        that.setData({
          code: '获取验证码',
          curTime: 60,
          idDisabled: false
        })
      }
    }, 1000)
  },
  toNext:function(e){
      tt.navigateTo({
        url: '../login-reset-password/login-reset-password',
      })
  }
})